package com.nineyang.bean;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

/*
 @PropertySource 注解来指定具体的配置文件
 */
@Configuration
@ConfigurationProperties(prefix = "mysql")
@PropertySource("classpath:application-mysql.properties")
public class Mysql {

   private String username;
   private String password;

    @Override
    public String toString() {
        return "Mysql{" +
                "username='" + username + '\'' +
                ", password='" + password + '\'' +
                '}';
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
